package com.demo.dao;

import com.demo.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface UserRepository extends JpaRepository<User, Long> {

    @Query(value = "select id,username,address from user where username like %?1%", nativeQuery = true)
    List<User> findAllByUsernameLike(String username);

}
